#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	char str[100 + 5], ch1, ch2;
	int len, i;
	cin >> str;
	if (strlen(str) == 1)
	{
		cout << "1" << str[0] << endl;
		return 0;
	}
	ch1 = str[0];
	len = 1;
	for (i = 1; i < strlen(str) - 1; i++)
	{
		ch2 = str[i];
		if (ch1 == ch2)len++;
		else
		{
			cout << len << ch1;
			len = 1;
		}
		ch1 = ch2;
	}
	if (str[strlen(str) - 1] == ch1)cout << len + 1 << ch1 << endl;
	else cout << len << ch1 << "1" << str[strlen(str) - 1] << endl;
	return 0;
}